<script>
function printContent(id){
	newwin=window.open('','printwin','left=10,top=10,width=400,height=400'
			+',menubar=1'
			+',toolbar=0'
			+',status=1'
			+',scrollbars=1'
			+',resizable=1');
	newwin.document.write('<HTML>\n<HEAD>\n');
	newwin.document.write('<TITLE>Print Ticket</TITLE>\n');
	newwin.document.write('</HEAD>\n');
	newwin.document.write('<BODY onload="window.print()">\n');
	newwin.document.write(
			'<div class="page-header"><h1>Ticket Summary <br/><small>Proof of payment - show this at the counter<br/></small></h1></div>'
			+'<div class="row"><div class="span5 offset2">'
			+'<table><caption>PURCHASE INFO</caption><tr>'
			+'<th>Name:</th><td><?php echo $ticket->first;?></td></tr>'
			+'<tr><th>Last Name:</th><td><?php echo $ticket->last;?></td></tr>'
			+'<tr><th>CC Number:</th><td><?php echo $ticket->creditcardnumber;?></td></tr>'
			+'<tr><th>CC Expires:</th><td><?php echo $ticket->creditcardexpiration;?></td></tr></table></div>'
			+'<div class="span5"><table><br/><caption>TICKET #<?php echo $ticket->ticket;?> INFO</caption><tr>'
			+'<th>Movie: </th><td><?php echo $showtime->title;?></td></tr>'
			+'<tr><th>Theater: </th><td><?php echo $showtime->name . ", " . $showtime->address;?></td></tr><tr>'
			+'<th>Show Time: </th><td><?php echo $showtime->date . ", " . $showtime->time;?></td></tr>'
			+'<tr><th>Seat: </th><td><?php echo $ticket->seat;?></td></tr></table></div></div>');
	newwin.document.write('</BODY>\n');
	newwin.document.write('</HTML>\n');
	newwin.document.close();
}
</script>

<div class="page-header">
	<h1>
		Ticket Summary <small>Proof of payment - show this at the counter</small>
	</h1>
</div>

<div class="row">
	<div class="span5 offset2">

		<table>
			<caption>PURCHASE INFO</caption>

			<tr>
				<th>Name:</th>
				<td><?php echo $ticket->first;?></td>
			</tr>

			<tr>
				<th>Last Name:</th>
				<td><?php echo $ticket->last;?></td>
			</tr>

			<tr>
				<th>CC Number:</th>
				<td><?php echo $ticket->creditcardnumber;?></td>
			</tr>

			<tr>
				<th>CC Expires:</th>
				<td><?php echo $ticket->creditcardexpiration;?></td>

			</tr>

		</table>


	</div>

	<div class="span5">

		<table>
			<caption>TICKET #<?php echo $ticket->ticket; ?> INFO</caption>

			<tr>
				<th>Movie: </th>
				<td><?php echo $showtime->title;?></td>
			</tr>

			<tr>
				<th>Theater: </th>
				<td><?php echo $showtime->name . ", " . $showtime->address;?></td>
			</tr>

			<tr>
				<th>Show Time: </th>
				<td><?php echo $showtime->date . ", " . $showtime->time;?></td>
			</tr>

			<tr>
				<th>Seat: </th>
				<td><?php echo $ticket->seat;?></td>
			</tr>

		</table>

	</div>
	<!-- close span -->
</div>
<!-- close row -->

<!-- button prints the page -->
<div class="row">
	<a href="#null" onClick="printContent('printTable')" class="btn btn-large btn-inverse">Print</a>
</div>
